﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContrctPersonEdit.aspx.cs" Inherits="PPAP.Web.Supplier.ContrctPersonEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function check() {
            var txtFirstName = document.getElementById("txtFirstName");
            var txtFamilyName = document.getElementById("txtFamilyName");
            var txtEmail = document.getElementById("txtEmail");
            if (txtFirstName.value == "") {
                alert(" 'First Name' for must fill in the item");
                txtFirstName.focus();
                return false;
            }
            if (txtFamilyName.value == "") {
                alert("'Family Name' for must fill in the item");
                txtFamilyName.focus();
                return false;
            }
            if (txtEmail.value == "") {
                alert("'Email' for must fill in the item");
                txtEmail.focus();
                return false;
            }
            var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
            if (!myreg.test(txtEmail.value)) {
                alert('Email format error！');
                return false;
            }


            return confirm('Are you sure you want to save?');
        }
        </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <table width="100%">
    <tr><td width="100px">
        First
       Name
        </td><td width="190px;">
            <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox><font color='red'>*</font>
        </td><td width="100px">
            Family Name</td><td>
            <asp:TextBox ID="txtFamilyName" runat="server"></asp:TextBox>
            <font color='red'>*</font>
        </td></tr>
    <tr><td>
           Gender
        </td><td>
            <asp:RadioButton ID="rbtMale" runat="server" Checked="True" GroupName="sex" 
                Text="male" />
            <asp:RadioButton ID="rbtfemale" runat="server" GroupName="sex" Text="female" />
        </td><td>
        Email</td><td>
            <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
            <font color="red">*</font>
        </td></tr>
    <tr><td>
            Telephone
        </td><td>
            <asp:TextBox ID="txtTelephone" runat="server"></asp:TextBox>
        </td><td>
            &nbsp;</td><td>
            &nbsp;</td></tr>
        <tr style="display:none;"><td>Status
        </td><td>
            <asp:RadioButton ID="rbtActive" runat="server" Checked="True" 
                GroupName="status" Text="active" />
            <asp:RadioButton ID="rbtInactive" runat="server" 
                GroupName="status" Text="inactive" />
            </td><td>Position
        </td><td>
            <asp:DropDownList ID="ddlPostition" runat="server">
                <asp:ListItem>Manager</asp:ListItem>
                <asp:ListItem>Admin</asp:ListItem>
            </asp:DropDownList>
            </td></tr>
    <tr><td colspan="4" align="center"><asp:Button ID="Button1" CssClass="button" runat="server" 
            Text="Add" onclick="Button1_Click" 
            onclientclick="return check();" /></td></tr></table>
    </div>
    </form>
</body>
</html>
